package org.desktop.web.server.factory;

import java.io.InputStreamReader;
import java.io.Reader;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.desktop.web.server.util.RpcUtil;

public class ConfigurationFactory {

	private static ConfigurationFactory factory;

	private static Configuration configuration = new PropertiesConfiguration();

	private ConfigurationFactory() {
	}

	public static final ConfigurationFactory getInstance() {
		return factory == null ? new ConfigurationFactory() : factory;
	}

	public void load(Reader reader) throws ConfigurationException {
		((PropertiesConfiguration) configuration).load(reader);
	}

	public static Configuration getConfiguration() {
		return configuration;
	}
	
}
